#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project ：BookStore 
@File    ：urls.py
@IDE     ：PyCharm 
@Author  ：XiaoDengYa
@Date    ：2021/8/6/006 9:43 
"""

from django.urls import path, re_path
from django.views.decorators.cache import cache_page

from index import views

app_name = 'index'  # 写在开始位置即可

urlpatterns = [
    path(r'tags/', views.test_tag),
    path(r'inclusion/', views.test_inclusion),
    path('test/', views.index_html, name="detail_hello"),
    path('redict/', views.redict_url),
    path("reverse/", views.test_to_reverse),
    re_path('test/(?P<year>[0-9]{4})/', views.year_test),
    re_path('test/(?P<id>[a-zA-Z0-9]+)/num/', views.num3_view),
    re_path('test/(?P<id>[a-zA-Z0-9]+)/num1/', views.num1_view),
    re_path('test/(?P<id>[a-zA-Z0-9]+)/num2/', views.num2_view),
    path("allbook/", views.BookName),
    path("annotate/", views.test_annotate),
    path("loginfbv/", views.login_fbv),
    path("logincbv/", views.LoginView.as_view(username="nihao")),  # 使用as_view()方法创建类实例
    path("login/", views.logins),
    path("set_cookie", views.set_cookie_view),
    path("get_cookie", views.get_cookie_view),
    path('search_title_form/', views.search_ttile_form),
    path('search_title/', views.search_ttile_form),
    path("search_titles/", views.search_title),
    path("all_book/", views.book_table),
    path("add_book/", views.add_book),
    path("book_not_list", views.book_not_list),
    path('update_book/<int:book_id>', views.update_book),
    path('delete_book/<int:book_id>', views.delete_book),
    path('user_add_form/', views.user_add_form),
    path("page_test/", views.page_test),
    path("send_email/", views.send_email),
    path("search_title_views/", views.search_title_views),
    path("uplod/", views.uplod),
    path("list_uplod/", views.list_uplod),
    path("csv/", views.test_csv),
    path("test_cache/", cache_page(15)(views.test_cache), ),
    path("test_time/", views.test_time),
]
